package com.trkj.pojos;

import java.io.Serializable;
import javax.persistence.*;
import java.util.List;


/**
 * The persistent class for the STAFF_TYPE database table.
 * 
 */
@Entity
@Table(name="STAFF_TYPE")
@NamedQuery(name="StaffType.findAll", query="SELECT s FROM StaffType s")
public class StaffType implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="STAFF_TYPE_ID")
	private long staffTypeId;

	private String name;

	//bi-directional many-to-one association to Staff
	@OneToMany(mappedBy="staffType")
	private List<Staff> staffs;

	public StaffType() {
	}

	public long getStaffTypeId() {
		return this.staffTypeId;
	}

	public void setStaffTypeId(long staffTypeId) {
		this.staffTypeId = staffTypeId;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public List<Staff> getStaffs() {
		return this.staffs;
	}

	public void setStaffs(List<Staff> staffs) {
		this.staffs = staffs;
	}

	public Staff addStaff(Staff staff) {
		getStaffs().add(staff);
		staff.setStaffType(this);

		return staff;
	}

	public Staff removeStaff(Staff staff) {
		getStaffs().remove(staff);
		staff.setStaffType(null);

		return staff;
	}

}